package com.superhelper.superhelper_web.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.superhelper.common.domain.TakeOutOrderStatus;
import com.superhelper.common.domain.User;
import com.superhelper.common.utils.JsonHelper;
import com.superhelper.superhelper_web.common.CommonHelper;
import com.superhelper.superhelper_web.controller.base.AbstractController;
import com.superhelper.superhelper_web.domain.Admin;
import com.superhelper.superhelper_web.domain.AuserShopAudio;
import com.superhelper.superhelper_web.domain.Order;
import com.superhelper.superhelper_web.domain.PageModel;
import com.superhelper.superhelper_web.domain.Resp;
import com.superhelper.superhelper_web.service.ElemeService;
import com.superhelper.superhelper_web.service.MtService;
import com.superhelper.superhelper_web.service.OrderService;
import com.superhelper.superhelper_web.service.ShopService;
import com.superhelper.superhelper_web.service.UserService;

import eleme.openapi.sdk.api.exception.ServiceException;

@Controller
@RequestMapping("admin/user")
public class UserController extends AbstractController {

	@Autowired
	private UserService userService;

	/**
	 * 查看
	 * 
	 * @return
	 * @throws ServiceException
	 */
	@RequestMapping("list")
	public String list(ModelMap model, HttpServletRequest request,
			PageModel pageModel) throws ServiceException {
		pageModel.setPageSize(15);
		Admin admin = CommonHelper.getSessionUser();
		List<User> list = userService.getUserList(pageModel,admin.getId());
		model.put("list", list);
		return "admin/user/list";
	}
}
